<?php
require_once "header_before_menu.php";
require_once "db.php";
require_once "util.php";
require_once "header_objects.php";

get_database_connection();

$object_id = $_REQUEST["id"];

// Inserting
$sql = "DELETE FROM objects WHERE id = $object_id";
$res = mysql_query($sql);

$sql = "DELETE FROM objects_users WHERE object_id = $object_id";
$res = mysql_query($sql);

$sql = "DELETE FROM slides WHERE object_id = $object_id";
$res = mysql_query($sql);

// Removing
$TMP_PREFIX = "tmp/";
$object_dir = dirname(__FILE__) . "/" . $TMP_PREFIX  . "/" . $object_id;
recursive_rmdir($object_dir);

set_flash("Objeto removido com exito.");
ddd_redirect("index.objects.php");
?>




